<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<div class="row">
	<div class="col-xs-12 col-sm-8">
		<div class="box">
			<div class="box-header">
				<div class="box-name">
					<i class="fa fa-search"></i> 
					<c:choose>
						<c:when test="${paper.id>0}">公告编辑</c:when>
						<c:otherwise>新建公告</c:otherwise>
					</c:choose>
					<span></span>
				</div>
				<div class="box-icons">
					<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
					</a> <a class="expand-link"> <i class="fa fa-expand"></i>
					</a> <a class="close-link"> <i class="fa fa-times"></i>
					</a>
				</div>
				<div class="no-move"></div>
			</div>
			<div class="box-content">
				<form id="defaultForm" method="post" action="AnnouncementSave"
					class="form-horizontal">
					<c:if test="${paper.id>0}">
						<input type="hidden" name="id" class="paperId" value="${paper.id}"/>
					</c:if>
				
					<fieldset>
						<div class="form-group">
							<label class="col-sm-3 control-label">标题</label>
							<div class="col-sm-5">
									<input type="text" class="form-control" name="title" value="${paper.title}"/>
							</div>
						</div>	
								<div class="form-group">
							<label class="col-sm-3 control-label">内容</label>
							<div class="col-sm-5">
								<input type="text" class="form-control" name="content" value="${paper.content}"/>
							</div>
						</div>				
						<input type="hidden" name="creatorId" value="${sessionScope.employee.id}"/>
						<input type="hidden" name="status" class="status" value="0"/>
					</fieldset>
					<div class="form-group">
						<div class="col-sm-9 col-sm-offset-3">
							<button type="submit" class="btn btn-primary draw">确认草稿</button>
							<button type="submit" class="btn btn-primary commit">提交</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script>
	$(function(){
		$(".draw").click(function(){
			$("input[class='status']").attr("value",0);
		})
		$(".commit").click(function(){
			console.log("click");
			$("input[class='status']").attr("value",2);
		})
		$("#announcement").addClass("active");
		$("#announcement").addClass("active-parent");
		$("#announcement ul li:nth-child(2)").addClass("active");
		$("#announcement").find("ul").show();
	})
</script>